package cn.cymym.control;

import java.io.IOException;
import java.lang.reflect.Method;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import cn.cymym.comm.CommException;

public class DimSelectServelt extends HttpServlet {
	private static final long serialVersionUID = -8942346760131720749L;
	private Logger logger = LoggerFactory.getLogger(DimSelectServelt.class);

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doPost(req, resp);
	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		String servletPath = req.getServletPath();
		String methodname = servletPath.substring(1);
		methodname = methodname.substring(0, methodname.length()-3);
		logger.info(methodname);
		try {
			Method method = getClass().getDeclaredMethod(methodname, HttpServletRequest.class,HttpServletResponse.class);
			method.invoke(this, req,resp);
		} catch (Exception e) {
			e.printStackTrace();
			throw new CommException("方法没有找到");
		} 
	}
	protected void dimSelectProInfo(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		String kw = req.getParameter("kw");
		logger.info(kw);
		
	}
	
	

}
